package com.zd.commodity.categoryMng.dao.impl;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.zd.commodity.categoryMng.dao.ICategoryMappingDao;
import com.zd.commodity.categoryMng.entity.CategoryMapping;
import com.zd.commodity.dao.impl.BaseDao;
@Repository
public class CategoryMappingDao extends BaseDao<CategoryMapping> implements ICategoryMappingDao{
	@Resource(name = "sessionFactory")
	public void setSuperSessionFactory(SessionFactory sessionFactory){
		super.setSessionFactory(sessionFactory);
	}

	@Override
	public DetachedCriteria getDetachedCriteria(CategoryMapping t1,
			CategoryMapping t2, Object param) {
		DetachedCriteria dc = DetachedCriteria.forClass(CategoryMapping.class);
		dc.add(Restrictions.eq("category4stId", t1.getCategory4stId()));
		return dc;
	}
	

}
